#include "geometry.h"


Geometry::Geometry(QWidget *parent)
    : QDialog(parent)
    //, ui(new Ui::Geometry)
{
    setupUi(this);
    setWindowTitle("Geometry");


    updateLabel();
}

Geometry::~Geometry()
{
    //delete ui;
}

void Geometry::updateLabel()
{
    QString temp;

    QString str_x;
    xLabel->setText(str_x.setNum(x()));

    QString str_y;
    yLabel->setText(str_y.setNum(y()));

    QString frameGeo;
    frameGeo = temp.setNum(frameGeometry().x()) + "," +
                temp.setNum(frameGeometry().y()) + "," +
                temp.setNum(frameGeometry().width()) + "," +
                temp.setNum(frameGeometry().height());
    frameGeoLabel->setText(frameGeo);

    QString position;
    position = temp.setNum(pos().x()) + "," + temp.setNum(pos().y());
    posLabel->setText(position);


    QString geo;
    geo = temp.setNum(geometry().x()) + "," +
            temp.setNum(geometry().y()) + "," +
            temp.setNum(geometry().width()) + "," +
            temp.setNum(geometry().height());
    geoLabel->setText(geo);

    QString w;
    widthLabel->setText(w.setNum(width()));

    QString h;
    heightLabel->setText(h.setNum(height()));

    QString r;
    r = temp.setNum(rect().x()) + "," + temp.setNum(rect().y()) + "," +
            temp.setNum(rect().width()) + "," + temp.setNum(rect().height());
    rectLabel->setText(r);

    QString s;
    s = temp.setNum(size().width()) + "," + temp.setNum(size().height());
    sizeLabel->setText(s);
}

void Geometry::moveEvent(QMoveEvent *)
{
    updateLabel();
}

void Geometry::resizeEvent(QMoveEvent *)
{
    updateLabel();
}

